﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using System.Data.SqlClient;

namespace ykglxt
{
    public partial class Form_YFKCX : Form
    {
        public Form_YFKCX()
        {
            InitializeComponent();
        }

        SqlConnection con;
        SqlDataAdapter sda;
        DataSet ds;
        BindingSource bs;
        SqlCommandBuilder builder;

        private void Form_YFKCX_Load(object sender, EventArgs e)
        {
            string sqlstr = "SELECT BM,MC FROM Dic_GYS";
            con = new SqlConnection(PublicUnit.ConnetionString);
            DataTable dtGYS = new DataTable();
            sda = new SqlDataAdapter(sqlstr, con);
            sda.Fill(dtGYS);
            cbGYS.DataSource = dtGYS;
            cbGYS.DisplayMember = "MC";
            cbGYS.ValueMember = "BM";
        }

        private void btnSave_Click(object sender, EventArgs e)
        {
            MessageBox.Show("保存成功！");
        }

        //private void tbGYS_TextChanged(object sender, EventArgs e)
        //{
        //    string ZJF = tbGYS.Text.Trim();
        //    string sqlstr = "SELECT MC AS '药品名称',BM AS '药品编码' FROM Dic_YP WHERE ZJF LIKE '" + ZJF + "%'";
        //    DataTable dtload = new DataTable();
        //    dgvYFKCX.Visible = true;
        //    sda = new SqlDataAdapter(sqlstr, con);
        //    DataSet ds1 = new DataSet();
        //    sda.Fill(ds1);
        //    dgvYFKCX.DataSource = ds1.Tables[0];
        //}
    }
}
